package courselection;

public class Student {
    private int id;  // 编号
    private String name;    // 姓名
    private String sex;    // 性别
    private Course selectCourse;    // 所选课程
    private Course dropcourse;
    // 空构造
    public Student() {
    }

    // 学生（编号、姓名、性别、所选课程）
    public Student(int id, String name, String sex, Course selectCourse) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.selectCourse = selectCourse;
    }

    // 打印学生信息
    public String toString() {
        return "\n学生信息：[" + "编号：" + id + "，姓名：" + name + "，性别：" + sex + "]"
                + "\n" + name + "选课信息：" + (selectCourse != null ? selectCourse.toString() : "未选课");
    }

    // 为学生设置所选课程
    public void setSelectCourse(Course selectCourse) {
        this.selectCourse = selectCourse;
    }
    public void dropCourse(Course dropcourse) {
    	this.dropcourse=dropcourse;
    	
    }
    // 下面是get、set方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Course getSelectCourse() {
        return selectCourse;
    }
    public Course dropCourse() {
    	return null;
    }
}

